<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .box{
            width: 900px;
            height: 30px;
            background-color: PINK;
            
        }
        li{
           float: left;
            width: 200px;
            height: 30px;
            list-style: none;
            line-height: 30PX;
            text-align: center;
        }
        .li1{
            width: 200px;
            height: 30px;
        }
        .ul1{
            width: 100px;
            height: 150px;
            margin: auto;
           
        }
        .li2{
            width: 100px;
            height: 30px;
            border: 1px solid gray;
            
        }
        .li2:hover{
            background-color: rgb(199, 233, 219);
        }
        a{
            text-decoration: none;
            color: black;
            
        }
    </style>
</head>
<body>
    <div>
        <ul class="box">
            <li class="li1">
                <a href="#">家用电器</a>
                <ul class="ul1">
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                </ul>
            </li>
            <li class="li1">
                <a href="#">家用电器</a>
                <ul class="ul1">
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                </ul>
            </li>
            <li class="li1">
                <a href="#">家用电器</a>
                <ul class="ul1">
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                </ul>
            </li>
            <li class="li1">
                <a href="#">家用电器</a>
                <ul class="ul1">
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                    <li class="li2">
                        <a href="#">电视</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
    <script>
        const box=document.querySelector('.box');
        const lis=box.children;
        for(let i=0;i<lis.length;i++){
            lis[i].onmouseover=function(){
                this.children[1].style.display='block';
            }
            lis[i].onmouseout=function(){
                this.children[1].style.display='none';
            }
        }
    </script>
</body>
</html>